#ifndef __LM_COLOR_H__
#define __LM_COLOR_H__

#include "curses.h"
#include "panel.h"
#include <stdint.h>


#define LM_COLOR_RED             COLOR_RED
#define LM_COLOR_GREEN           COLOR_GREEN
#define LM_COLOR_BLUE            COLOR_BLUE
#define LM_COLOR_CYAN            (COLOR_BLUE | COLOR_GREEN)
#define LM_COLOR_MAGENTA         (COLOR_RED | COLOR_BLUE)
#define LM_COLOR_YELLOW          (COLOR_RED | COLOR_GREEN)
#define LM_COLOR_WHITE           COLOR_WHITE


typedef struct lm_color {
    short rgb_fg_index;
    short rgb_bg_index;
    short pair;
    short fg;
    short bg;

}lm_color_t;

struct lm_color_pair_info {
    short use_flag;
    short fg;
    short bg;
};

#ifdef __cplusplus
extern "C" {
#endif

void lm_init_palette(void);
uint16_t lm_rgb_convert_color_index(uint8_t red, uint8_t green, uint8_t blue);
short lm_color_pair_getfree(void);
int lm_init_pair(short fg, short bg);
short lm_pair_get_fg(short pair);
short lm_pair_get_bg(short pair);
int lm_color_swap(lm_color_t color);


#ifdef __cplusplus
} /*extern "C"*/
#endif

#endif // !__LM_COLOR_H__
